import Vue from 'vue'
import Router from 'vue-router'
import home from '@/views/home'
import login from '@/views/login'

Vue.use(Router)

export default new Router({
    mode: 'history',
    routes: [{
        path: '/',
        name: 'home',
        meta: {
            isLogin: true, //需要登录
            title: "泸宝酒后台系统"
        },
        component: home,
        children: [{
                path: '/productList',
                name: 'productList',
                meta: {
                    isLogin: true,
                    title: "商品列表"
                },
                component: () =>
                    import ('@/components/productList')
            }, {
                path: '/categoryList',
                name: 'categoryList',
                meta: {
                    isLogin: true,
                    title: "分类管理"
                },
                component: () =>
                    import ('@/components/categoryList')
            }, {
                path: '/slideshow',
                name: 'slideshow',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/slideshow')
            }, {
                path: '/recommend',
                name: 'recommend',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/recommend')
            }, {
                path: '/addGoods/:id',
                name: 'addGoodsDetail',
                meta: {
                    isLogin: true,
                    title: "商品详情"
                },
                component: () =>
                    import ('@/components/GoodsAdd/addGoods')
            }, {
                path: '/addGoods',
                name: 'addGoods',
                meta: {
                    isLogin: true,
                    title: "商品信息"
                },
                component: () =>
                    import ('@/components/GoodsAdd/addGoods')
            }, {
                path: '/information',
                name: 'information',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/GoodsAdd/information')
            }, {
                path: '/Goodsphoto',
                name: 'Goodsphoto',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/GoodsAdd/Goodsphoto')
            }, {
                path: '/proDetails',
                name: 'proDetails',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/GoodsAdd/proDetails')
            }, {
                path: '/putawayStores',
                name: 'putawayStores',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/GoodsAdd/putawayStores')
            },
            {
                path: '/marketing',
                name: 'marketing',
                meta: {
                    isLogin: true,
                },
                component: () =>
                    import ('@/components/marketing')
            }
        ]
    }, {
        path: '/login',
        name: 'login',
        meta: {
            title: "登录"
        },
        component: login,
    }]
})